// import { getAllRoleList, isAccountExist } from '@/api/demo/system';
import { BasicColumn, FormSchema } from '@/components/Table';
import { useI18n } from "@/hooks/web/useI18n";

const { t } = useI18n();
const MatchingType = [
  {
    label: t('sys.configuration.notStart'),
    value: t('sys.configuration.notStart'),
  },
  {
    label: t('sys.configuration.inProgress'),
    value: t('sys.configuration.inProgress'),
  },
  {
    label: t('sys.configuration.taskSucces'),
    value: t('sys.configuration.taskSucces'),
  },
  {
    label: t('sys.configuration.taskStop'),
    value: t('sys.configuration.taskStop'),
  },
];
//表头数据
export const columns: BasicColumn[] = [
  {
    title: t('sys.informaionMatchaing.columns.title'),
    dataIndex: 'mac',
    width: 50,
  },

  {
    title: t('sys.configuration.describe'),
    dataIndex: 'ip',
    width: 50,
  },
  {
    title: t('sys.informaionMatchaing.columns.category'),
    dataIndex: 'name',
    width: 50,
  },
  {
    title: t('sys.informaionMatchaing.columns.DatePicker'),
    dataIndex: 'toDesk',
    width: 50,
  },
];

export const accountFormSchema: FormSchema[] = [
  {
    field: 'title',
    component: 'Input',
    label: t('sys.informaionMatchaing.columns.title'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    rules: [{ required: true }],
  },
  {
    field: 'remark',
    component: 'InputTextArea',
    label: t('sys.configuration.describe'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      rows: 3, // 设置文本域的行数
    },
    rules: [{ required: true }],
  },
  // {
  //   field: 'type',
  //   component: 'Input',
  //   label: t('sys.informaionMatchaing.columns.type'),
  //   defaultValue: '',
  //   colProps: {
  //     span: 24,
  //   },
  //   rules: [{ required: true }],
  // },
  {
    field: 'category',
    component: 'AutoComplete',
    label: t('sys.informaionMatchaing.columns.category'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      options: MatchingType,
      filterOption: (inputValue, option) => {
        return option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
      },
    },
    rules: [{ required: true }],
  },
  {
    field: 'date',
    component: 'DatePicker',
    label: t('sys.informaionMatchaing.columns.DatePicker'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss', // 设置显示格式
      showTime: true, // 显示时间选择器
      valueFormat: 'YYYY-MM-DD HH:mm:ss', // 设置返回值的格式
    },
    rules: [{ required: true }],
  },
];

//定向匹配
export const accountFormSchemapositon: FormSchema[] = [
  {
    field: 'title',
    component: 'Input',
    label: t('sys.informaionMatchaing.columns.title'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    rules: [{ required: true }],
  },
  {
    field: 'remark',
    component: 'InputTextArea',
    label: t('sys.configuration.describe'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      rows: 3, // 设置文本域的行数
    },
    rules: [{ required: true }],
  },

  // {
  //   field: 'type',
  //   component: 'Input',
  //   label: t('sys.informaionMatchaing.columns.type'),
  //   defaultValue: '',
  //   colProps: {
  //     span: 24,
  //   },
  //   rules: [{ required: true }],
  // },
  // {
  //   field: 'status',
  //   component: 'Select',
  //   label: '匹配状态',
  //   defaultValue: '',
  //   colProps: {
  //     span: 24,
  //   },
  //   componentProps: {
  //     options: MatchingType,
  //   },
  //   rules: [{ required: true }],
  // },
  {
    field: 'category',
    component: 'AutoComplete',
    label: t('sys.informaionMatchaing.columns.category'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      options: MatchingType,
      filterOption: (inputValue, option) => {
        return option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1;
      },
    },
    rules: [{ required: true }],
  },
  {
    field: 'date',
    component: 'DatePicker',
    label: t('sys.informaionMatchaing.columns.DatePicker'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss', // 设置显示格式
      showTime: true, // 显示时间选择器
      valueFormat: 'YYYY-MM-DD HH:mm:ss', // 设置返回值的格式
    },
    rules: [{ required: true }],
  },
  {
    field: 'maxNum',
    component: 'Input',
    label: t('sys.orientation.maxNum'),
    /**!!!renderColContent 没有FormItem 包裹, 若想要 Form 提交需要带上数据须 <FormItem name={}></FormItem> 包裹： 示例如下*/
    colProps: {
      span: 24,
    },
  },
  {
    field: 'maxNode',
    component: 'Input',
    label: t('sys.orientation.maxNode'),
    /**!!!renderColContent 没有FormItem 包裹, 若想要 Form 提交需要带上数据须 <FormItem name={}></FormItem> 包裹： 示例如下*/
    colProps: {
      span: 24,
    },
  },
  // {
  //   field: 'keywordValue',
  //   component: 'Input',
  //   label: t('sys.orientation.keyword'),
  //   /**!!!renderColContent 没有FormItem 包裹, 若想要 Form 提交需要带上数据须 <FormItem name={}></FormItem> 包裹： 示例如下*/
  //   colSlot: 'colSlot_field5',
  //   colProps: {
  //     span: 12,
  //   },
  //   dynamicDisabled: ({ values }) => {
  //     return !!values.field_disabled;
  //   },
  // },
];
